#include <tsin/util/Logger.hpp>

using namespace tsin;

namespace tsin {
        Logger *logp = 0;
}

const char *Logger::logLevelString[ALL] = {
        "BUG      - ",
        "ALERT    - ",
        "WARNING  - ",
        "INFO     - ",
        "DEBUG    - "
};

Logger::Logger()
        : current(DEBUG), filter(DEBUG)
{
}

Logger &Logger::setLogLevel(LogLevel level)
{
        if (level != Logger::CONTINUE) {
                current = level;
                *this << logLevelString[current];
        }
        return *this;
}

void Logger::setFilterLevel(LogLevel level)
{
        filter = level;
}
